{% extends "base.html" %}
{% set title = "添加教师" %}
{% block content %}
    <h2>添加教师</h2>
    <form action="{{ url_for('add_teacher') }}" method="post">
        <div class="form-group">
            <label for="username">姓名:</label>
            <input type="text" class="form-control" id="username" name="username" required>
        </div>
        <div class="form-group">
            <label for="age">年龄:</label>
            <input type="number" class="form-control" id="age" name="age" required>
        </div>
        <div class="form-group">
            <label for="gender">性别:</label>
            <select class="form-control" id="gender" name="gender" required>
                <option value="男">男</option>
                <option value="女">女</option>
            </select>
        </div>
        <div class="form-group">
            <label for="title">职称:</label>
            <input type="text" class="form-control" id="title" name="title" required>
        </div>
        <!-- 专业: 
        <select name="major_id">
            <option value="">无专业</option>
            {% for major in majors %}
            <option value="{{ major.id }}">{{ major.name }}</option>
            {% endfor %}
        </select><br> -->
        <div class="form-group">
            <label for="major_id">专业:</label>
            <select class="form-control" id="major_id" name="major_id" required>
                <option value="无专业">无专业</option>
                {% for major in majors %}
                <option value="{{ major.id }}">{{ major.name }}</option>
                {% endfor %}
            </select>
        </div>
        <br>
        <!-- 专业: 
        <select name="major_id">
            <option value="">无专业</option>
            {% for major in majors %}
            <option value="{{ major.id }}">{{ major.name }}</option>
            {% endfor %}
        </select><br> -->
        <button type="submit" class="btn btn-primary">添加</button>
    </form>
    <br>
    <a href="{{ url_for('list_teachers') }}" class="btn btn-secondary">返回教师列表</a>
{% endblock %}
